﻿@model IEnumerable<CompanyHubServer.Models.Package>

@{
    ViewBag.Title = "Index.cshtml";
}


<h2>Manage Apps</h2>


<form action="" method="post" enctype="multipart/form-data">

    <label for="file">Filename:</label>
    <input type="file" name="file" id="file" />

    <div>
        <label><input type="checkbox" name="isHub" value="true" style="vertical-align: middle" /> Company Hub App</label>
    </div>
    <div style="padding-top: 1em">
        <input type="submit" value="Upload" />

    </div>

</form>

<h3 style="padding-top: 2em">Available Apps</h3>
<table>
    <tr>
        <th>App Name
        </th>
        <th>Version
        </th>
        <th>Publisher
        </th>
        <th>Status
        </th>
        <th>Uploaded Date/Time
        </th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Title)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Version)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Publisher)
            </td>
            <td>
                @if (item.IsActive)
                {
                    <span style="font-weight: bold; color: green">Active</span>
                }
                else
                {
                    <span>Inactive</span>   
                }
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.UpdatedDT)
            </td>
        </tr>
    }
</table>
